<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script>
    /*
     * @description: 鼠标hover图片反转的效果
     * @fileName: index.html 
     * @author: DangPeng
     * @date: 2024-02-23 13:12:13 
    */
</script>

<body>
    <div class="container">
        <div class="flipper">
            <div class="front">
                <!-- 前面内容 -->
                <img src="./imgs/apple.png" style="width:100%;height: 100%;" alt="">
            </div>
            <div class="back">
                <!-- 背面内容 -->
                背面内容
            </div>
        </div>
    </div>
    <style>
        body {
            background-color: #2e2b2b;
            padding: 0 45%;
        }

        .container {
            perspective: 10000px;
        }

        .container:hover .flipper {
            transform: rotateY(180deg);
        }

        .container,
        .front,
        .back {
            width: 320px;
            height: 480px;
        }

        .flipper {
            transition: 0.6s;
            transform-style: preserve-3d;
            position: relative;
        }

        .front,
        .back {
            backface-visibility: hidden;
            position: absolute;
            top: 0;
            left: 0;
        }

        .front {
            z-index: 2;
        }

        .back {
            transform: rotateY(180deg);
            background: #0facee;
        }
    </style>
</body>

</html>